<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../common/tag.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>阅学网_问答管理</title>
<meta name="Keywords" content="疑问、回答、问题">
<meta name="description" content="提供互动的平台，有不懂的问题可以在此发布出来!">
<%@ include file="../common/common.jsp"%>
<script type="text/javascript">
		$(function(){
				$('.divs ul li').click(function(){
					var index = $(this).index();
					$(this).addClass('div-li').siblings().removeClass('div-li');
					$('.answer-content:eq('+index+')').css('display','block').siblings().css('display','none');
				});
				
		});
</script>
</head>
<body>
	<jsp:include page="../top.jsp"></jsp:include>
	<div class="yc_container">
		<div class="question-type" style="border: 1px solid #F0F5F3; margin-top: 3px;">
			<ul>
				<c:forEach items="${questionTypes}" var="questionType">
					<li style="margin-right: 18px;">
						<div style="border: 1px solid #DAECF5; text-align: center; border-radius: 25px; width: 120px;">
								<a href="public/question/questionByTypeList?id=${questionType.id}" title="${questionType.questionTypeName }">${questionType.questionTypeName }</a>
						</div>
					</li>
				</c:forEach>
			</ul>
		</div>

		<div id="answer">
			<div class="divs">
				<ul>
					<li class="div-li">
						<a href="javascript:void(0);">所有提问</a>
					</li>
					<%-- 
							<li><a href="javascript:void(0);">急求回答<sup style="color: red;position: absolute;margin-top: -4px;font-size: 14px;">急</sup></a></li>
							 --%>
				</ul>
			</div>
			<div id="answer-main">
				<div class="answer-content" style="display: block;">
					<div class="answer-question">
						<table style="width: 1150px;">
							<c:forEach items="${questions}" var="question">
								<tr>
									<td style="color: #E7412B;width: 80px;"><img src="images/jifen.png" />&nbsp;&nbsp;${question.questionIntegral}</td>
									<td class="detail"><a
										href="public/question/questionDetail?id=${question.id}">${question.questionTitle}</a></td>
									<td class="td-center">(${question.questionAnswerCount })
										回答</td>
									<td class="td-center"><fmt:formatDate
											value="${question.createDate}" type="both"
											pattern="yyyy-MM-dd HH:mm:ss" /></td>
								</tr>
							</c:forEach>
						</table>
					</div>
					<div class="page">
						<span><a href="communityAnswer.do?pageNow=1">首页</a></span>
						<c:choose>
							<c:when test="${page.pageNow -1 >0}">
								<span><a href="communityAnswer?pageNow=${page.pageNow-1}">上一页</a></span>
							</c:when>
						</c:choose>
						<c:forEach begin="1" end="${page.totalPageCount}" var="pageIndex">
							<c:choose>
								<c:when test="${page.pageNow==pageIndex}">
									<span><a href="javascript:void(0);"
										style="float: left; background: #EAEAEA;">${pageIndex }</a></span>
								</c:when>
								<c:otherwise>
									<span><a href="communityAnswer?pageNow=${pageIndex}"
										target="_self">${pageIndex }</a></span>
								</c:otherwise>
							</c:choose>
						</c:forEach>
						<c:choose>
							<c:when test="${page.pageNow <page.totalPageCount}">
								<span><a
									href="communityAnswer?pageNow=${page.pageNow+1 }"
									target="_self">下一页</a></span>
							</c:when>
						</c:choose>
						<span><a
							href="communityAnswer?pageNow=${page.totalPageCount}">末页</a></span>
					</div>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="../bottom.jsp"></jsp:include>
</body>
</html>
